package com.dalin.framework.service.imple;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.dalin.common.pager.Condition;
import com.dalin.common.pager.PageInfo;
import com.dalin.framework.dao.DbDao;
import com.dalin.framework.service.FrameService;

/*****************************************************************************
 * @content: 抽象服务类                                                                                                                           *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2009-04-27                                                     *
 * @chaDate: 2010-05-16                                                     *
 * @version: 1.6                                                            *
 ****************************************************************************/
public class FrameServiceImple implements FrameService {
	protected static final Log log = LogFactory.getLog(FrameServiceImple.class);
	private DbDao dao; // 公共数据库操作服务
	
	public List queryListByCond(Condition cond) {
		return dao.queryObjsToPages(cond.getPreparedPageQuery());
	}
	

	public PageInfo queryPageInfoByCond(Condition cond) {
		return new PageInfo(dao.getTotalRowsNum(cond.getPreparedPageQuery()),
				dao.queryObjsToPages(cond.getPreparedPageQuery()));
	}
	
	
	
	
	
	
	
	
	
	
	
	/*************************************************************************
	 * 以下是bean属性的set/get方法
	 */
	public void setDao(DbDao dao) {
		this.dao = dao;
	}
	public DbDao getDao() {
		return dao;
	}
}
